from django.contrib.auth.models import Group, Permission
from rest_framework import serializers


class GroupListSerializer(serializers.ModelSerializer):

    class Meta:
        model = Group
        fields = ['id', 'name', 'permissions']


# 在分组中应用的权限列表数据
class NewPermissionListSerializer(serializers.ModelSerializer):
    class Meta:
        model = Permission
        fields = ['id', 'name']